package org.wheres.core.thread;

import org.jivesoftware.smack.XMPPConnection;
import org.jivesoftware.smack.XMPPException;

import android.util.Log;

public class ConnectionThread extends Thread {
	
	private XMPPConnection connection;
	
	
	public ConnectionThread(XMPPConnection connection) {
		this.connection = connection;
	}
	
	@Override
	public void run() {
		try {
			if(!connection.isConnected()){
				connection.connect();
				Log.i("Communicator", "Connesso...");
			}else
				Log.i("Communicator", "Gia' connesso...");
		} catch (XMPPException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	

}
